Servo is a type of motor where you can control how the motor moves. The speed of this particular one cannot be controlled, though the position of it is changeable.

Like other electronics, you'd need to wire up the servo to a pin, and another wire to ground.

servo code

This is the example code provided inside the arduino app. I only used a servo for this video below, but the code above says there is a "potpin=0;" yet there is nothing connected to pin 0. That means we are using "noise" (uncontrollable) values which are random as an input.

the "map()" function here tells us that we will convert the 1st variable to 4 numbers, the 1st and 2nd being the input value range, whereas the 3rd and 4th are the post-converted range.

For some reason the servo keeps moving only between those few positions. I believe the randomness of the potval has a limited range.

Here's the original code (with download link at image below!)

download here
AC DC series / servo https://www.arduino.cc/en/reference/servo